/**
 * 
 */
package ch.gje.playios.server.handler;

import java.io.IOException;

import ch.gje.playios.server.HTTPConnection;

/**
 * Sends 404 Not Found
 * 
 * @author jannis <jannis@gje.ch>
 */
public class NotFoundHandler extends RequestHandler {

    /**
     * Constructor
     *
     * @param connection
     *            the HTTP connection
     */
    public NotFoundHandler(HTTPConnection connection) {
        super(connection);
        handle();
    }

    /*
     * (non-Javadoc)
     *
     * @see server.QueryHandler#handleQuery(java.lang.String)
     */
    @Override
    public void handleQuery() throws IOException {
        setResponseStatus(404, "Not Found");
        sendHeaders();
        connection.send("404 Not Found");
        connection.close();
    }
}
